<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Template
{
	private $CI;
	private $template_file;
	private $template_data = array();
	
	public function __construct($template = 'template') {
		$this->CI =& get_instance();
		$this->template_file = $template;
	}
	
	public function set_template($template) {
		$this->template_file = $template;
	}
	
	public function set_data($key, $value) {
		$this->template_data[$key] = $value;
	}

	public function display($view = '', $data = array()) {
		$this->template_data['content'] = $this->CI->load->view($view, $data, TRUE);
		$this->CI->load->view($this->template_file, $this->template_data);
	}
	
}